import React, { Suspense, lazy } from 'react'
import { Navigate } from 'react-router-dom'
/* const Index = lazy(() => import('@/pages/Index'))
const Detail = lazy(() => import('@/pages/Detail'))
const Test = lazy(() => import('@/pages/test'))
const A = lazy(() => import('@/pages/a')) */

const lazyLoad = src => <Suspense>{React.createElement(lazy(src))}</Suspense>

const routerConfig = [
  /* {
    path: '/',
    element: <Navigate to="/ys/home/0" />
  }, */
  {
    path: '/',
    element: lazyLoad(() => import('@/pages/Index'))
  },
  {
    path: '/detail/:id',
    element: lazyLoad(() => import('@/pages/Detail'))
  }
]

export default routerConfig
